<template>
	<!-- :style="{'background-image':'url('+imgUrl+'news/bg.png'+')'}" -->
	<view class="personalcenter" >
		<uni-nav-bar :fixed="false" :border="false" :statusBar="true"
			background-color="rgba(0, 0, 0, 1)"></uni-nav-bar>
		<!-- 状态栏占位 -->
		<!-- <view style="height: 75rpx;"></view> -->
		<view class="personhead"  @tap="goPage('/page_wallet/uni_Changeimg')">
			<view class="personheadimg">
				<image class="headimg" :src="userInfo.exts?userInfo.exts.headimgurl:logoImg"></image>
			</view>
			<view class="personheadcon" >
				<view class="nickname">
					<view class="nicknameClass">
						{{userInfo.realname?userInfo.realname:'微信用户'}}
					</view>
				</view>
				<view class="personinvite">
					<!-- <view class="personinviteone" >
							{{userInfo.id.toString().padEnd(6, '0')}}
					</view> -->
				</view>
			</view>
		</view>
		<view class="personalcenter-box">
				<view class="kf kf-box" >
					<view class="kfli" @tap="goPage('/page_wallet/orderList?type=1')">
						<!-- <image class="kfliimg" src="@/static/img/1.png" mode="widthFix"></image> -->
						<view>{{orderNum}}</view>
						<view class="kflitext">
							我的订单
						</view>
					</view>
					<view class="kfli" @tap="goPage('/page_wallet/peopleList')">
						<!-- <image class="kfliimg" src="@/static/img/3.png" mode="widthFix"></image> -->
						<view>{{contactsNum}}</view>
						<view class="kflitext">
							联系人
						</view>
					</view>
					<view class="kfli" @tap="goPage('/page_wallet/collect')">
						<view>{{collectedNum}}</view>
						<!-- <image class="kfliimg" src="@/static/img/4.png" mode="widthFix"></image> -->
						<view class="kflitext">
							收藏
						</view>
					</view>
				</view>
				
				<view class="personalist" >
					<view class="kf" >
						<view class="kfli" @tap="goPage('/page_wallet/uni_Addresslist')">
							<!-- <image class="kfliimg" :src="imgUrl+'userCenter/myaddress.png'" mode="widthFix"></image> -->
							<i class="iconfont icon-weizhi" />
							<view class="kflitext">
								地点管理
							</view>
						</view>
						<view class="kfli" @tap="goPage('/page_wallet/qualification')">
							<!-- <image class="kfliimg" :src="imgUrl+'userCenter/myabout.png'" mode="widthFix"></image> -->
							<i class="iconfont icon-V" />
							<view class="kflitext">
								营业资质
							</view>
						</view>
						<view class="kfli" @tap="goPage('/page_wallet/report_type')">
							<!-- <image class="kfliimg" :src="imgUrl+'userCenter/mypraise.png'" mode="widthFix"></image> -->
							<i class="iconfont icon-pingjia1" />
							<view class="kflitext">
								意见反馈
							</view>
						</view>
						<view class="kfli" @tap="goPage('/page_wallet/orderList1?type=2')">
							<!-- <image class="kfliimg" :src="imgUrl+'userCenter/myset.png'" mode="widthFix"></image> -->
							<i class="iconfont icon-set" />
							<view class="kflitext">
								售后退款
							</view>
						</view>
					</view>
				</view>
		</view>
		<button class="xcxkf" open-type="contact">
			<image class="xcxkfliimg" src="@/static/img/kefu.png" mode="widthFix"></image>

		</button>
		<!-- #ifdef MP-WEIXIN -->
			<get-number v-if="login_status===1" />
		<!-- #endif -->
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex'
	export default {
		components: {},
		data() {
			return {
				imgUrl: this.$apiFun.imgUrl,
				host: this.$apiFun.host,
				banner_list: [],
				bj: this.$apiFun.imgUrl + 'bj.png',
				logoImg:require('@/static/img/logo.png'),
				collectedNum:0,//我的收藏数量
				contactsNum:0,//联系人数量
				orderNum:0,//订单数量
			}
		},
		computed: {
			//login_status 0 未登录 、1临时微信登录 2已登录
			...mapGetters([
				'login_status',
				'userInfo',
				'configObj'
			])
		},
		onShow() {
			this.init()
		},
		methods: {
			// 跳转轮播页面
			goPage(item) {
				if (item.returnUrl) {
					uni.navigateTo({
						url: item.returnUrl
					})
				}
			},
			//初始化方法
			async init(){
				var data = {}
				const res = await this.$apiFun.getApi(this.$api.userDetailApi,data)
				this.$store.dispatch('setUserInfos', res)
				this.contactsNum = res.contactsList?res.contactsList.length:0
				
				let res1 = await this.$apiFun.getApi(
				  this.$api.collectedListApi,{page: 1,}
				)
				this.collectedNum = res1.totalSize
				let res2 = await this.$apiFun.getApi(
					this.$api.orderListApi,{page: 1,}
				)
				this.orderNum = res2.totalSize
			},
			// 登录
			loginBtn() {
				this.$apiFun.localstoryPage()
			},
			// 个人资料
			setFun() {
				uni.navigateTo({
					url: '/page_wallet/uni_Personinfo'
				});
			},
			// 个人中心分类操作
			goPage(url) {
				uni.navigateTo({
					url: url,
				});
			},
		}
	}
</script>
<style>
	page{
		height:100%;
		background: #000000;
		color: white;
	}
</style>
<style scoped lang="less">
	page {
		height: 100%;

	}
	.personalcenter-box{
		border-radius: 30rpx 30rpx 0  0;
		
	}
	/* 状态栏占位 */
	.status-contents {
		height: var(--status-bar-height);
	}

	.top-view {
		width: 100%;
		position: fixed;
		top: 0;
		height: var(--status-bar-height);
	}

	.kf-box {
		width: 90% !important;
		margin: 0 auto;
		background-color: rgba(255, 255, 255, 0.1);
		box-shadow:0px 2px 2px rgba(0,0,0,0.1);
		border-radius: 10rpx;

		.kfli {
			width: 33.3% !important;
		}
	}

	// 会员入口
	.component__vip_box {
		width: 100%;
		padding: 0 30rpx;
		box-sizing: border-box;

		.component__vip {
			font-size: 30rpx;
			width: 100%;
			height: 90rpx;
			background: -webkit-linear-gradient(228deg, #3f1e10 0%, #100806 100%);
			background: -o-linear-gradient(228deg, #3f1e10 0%, #100806 100%);
			background: linear-gradient(222deg, #3f1e10 0%, #100806 100%);
			border-radius: 10rpx;
			padding: 0 30rpx;
			box-sizing: border-box;
			display: flex;
			align-items: center;

			.flex.f-ai-c,
			.inflex.f-ai-c {
				-webkit-box-align: center;
				-webkit-align-items: center;
				-ms-flex-align: center;
				align-items: center;

				image {
					width: 100rpx;
					height: 25rpx;
				}
			}

			.vip__left {
				display: flex;
				align-items: center;
				flex: 1;

				.vip__left--divider {
					width: 4rpx;
					height: 16rpx;
					background: #fdeac5;
					opacity: 0.74;
					margin: 0 8rpx;
				}

				.vip__left--content {
					font-size: 24rpx;
					font-weight: 400;
					color: #fdeac5;
				}
			}


			.vip__button {
				height: 48rpx;
				width: 150rpx;
				background: #fdeac5;
				border-radius: 4rpx;
				padding: 0 8rpx 0 2rpx;
				font-size: 24rpx;
				font-weight: 400;
				color: #2f2122;
				display: flex;
				align-items: center;
				justify-content: center;

				.iconfont {
					color: #2f2122;
				}
			}

		}

	}

	/* // 轮播 */
	.swiperBox {
		margin: 20rpx auto;
		padding: 0 30rpx;
		box-sizing: border-box;
		height: 140rpx;
		width: 100%;

		.swiperBoxImg {
			width: 100%;
			height: 100%;
			border-radius: 10rpx;
		}
	}

	.personalcenter {
		height: 100%;
		// background-color: #EBECF0;
		background-repeat: no-repeat;
		background-size: 100% 600rpx;
	}

	.personhead {
		display: flex;
		padding: 30rpx 30rpx 0;
		box-sizing: border-box;
		margin:0 auto 50rpx;
	}

	.personheadimg {
		width: 155rpx;
		height: 155rpx;
		position: relative;
		overflow: hidden;
		display: flex;
		justify-content: center;
		align-items: center;

		.headimg {
			border-radius: 150rpx;
			width: 150rpx;
			height: 150rpx;
			box-shadow: 0rpx 0 5rpx #3b82f6;
		}

		.headimgVip {
			position: absolute;
			bottom: 0;
			right: 0;
			height: 25rpx;
			width: 50rpx;
		}
	}

	.personheadcon {
		width: 470rpx;
		padding-top: 28rpx;
		margin-left: 30rpx;
	}

	.personheadcon .nickname {
		font-size: 42rpx;
		height: 40rpx;
		line-height: 40rpx;
		font-weight: bold;
				color: rgba(255, 255, 255, 1);

		.nicknameClass {
			display: flex;
			align-items: flex-end;
				color: rgba(255, 255, 255, 1);
			
			.iconfont {
				font-size: 28rpx;
				padding-left: 10rpx;
			}
		}
	}

	.commentlisttopgrade {
		font-family: "Verdana";
		font-style: italic;
		display: inline-block;
		padding: 5rpx 10rpx;
		line-height: 30rpx;
		align: center;
		font-size: 24rpx;
		color: white;
		margin-left: 10rpx;
	}

	.personinvite {
		display: flex;
		margin-top: 20rpx;

		.communityListNavTitleLeftTopImg {
			height: 40rpx;
			width: 40rpx;
			display: inline-block;
			margin: 0 10rpx;
		}

		.communityListNavTitleLeftTopImg1 {
			height: 40rpx;
			width: 75rpx;
			display: inline-block;
			margin: 0 10rpx;
		}

		.personinviteone {
			box-sizing: border-box;
			white-space: nowrap;
			min-width: 160rpx;
			height: 46rpx;
			line-height: 46rpx;
			text-align: left;
			margin-right: 15rpx;
			font-size: 24rpx;
				color: rgba(255, 255, 255, .7);
		}
	}

	.personheadset {
		width: 48rpx;
		margin-top: 70rpx;
	}

	.mycontent {
		margin-top: 40rpx;
		margin-bottom: 50rpx;
		display: flex;
		text-align: center;
	}

	.myorderclass {
		width: 690rpx;
		margin: 30rpx auto 20rpx;
				background-color: rgba(255, 255, 255, 0.1);
		border-radius: 22rpx;
		box-shadow: 0 3px 17px rgba(0, 0, 0, 0.1);

		.myorderclasshead {
			height: 94rpx;
			line-height: 34rpx;
			padding: 30rpx;
			box-sizing: border-box;
			display: flex;
			border-bottom: 1px solid #efefef;
		}

		.myorderclasshead view {
			width: 50%;
		}

		.myorderclasshead .left {
			font-size: 34rpx;
			color: #2E2E2E;
		}

		.myorderclasshead .right {
			text-align: right;
			font-size: 26rpx;
			color: #979797;
			padding-right: 33rpx;
			box-sizing: border-box;
			background: url(@/static/img/godtail.png) no-repeat right;
			background-position-y: center;
			background-size: 13rpx 24rpx;
		}
	}


	.myorderclassbox {
		display: flex;
		align-items: center;
		justify-content: space-around;
		padding-top: 40rpx;
		padding-bottom: 50rpx;

		.myorderclassli {
			position: relative;
			width: 20%;
			text-align: center;
		}

		.myorderclassliimg {
			width: 60rpx;
			height: 50rpx;
		}

		.myorderclassliname {
			height: 24rpx;
			line-height: 24rpx;
			font-size: 24rpx;
			color: #2e2e2e;
			margin-top: 10rpx;
		}

		.myorderclassli span {
			display: block;
			position: absolute;
			top: -18rpx;
			right: 26rpx;
			width: 30rpx;
			height: 30rpx;
			line-height: 26rpx;
			font-size: 22rpx;
			color: #999999;
			text-align: center;
			background-color: #FFFFFF;
		}
	}

	.personalist {
		width: 90%;
		margin: 20rpx auto;
		box-sizing: border-box;
	}

	.kf {
		width: 100%;
		margin: 20rpx auto;
		padding: 0 0 45rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		border-radius: 10rpx;

		.kfli::after {
			display: none;
			/* 去除按钮后的边框 */
		}

		.kfli {
			width: 25%;
			display: block;
			text-align: center;
			position: relative;
			background-color: transparent;
			border: none;
			line-height: initial;
			margin: 45rpx 0 0;
			padding: 0 30rpx;
			box-sizing: border-box;
			/* 去除内边距 */
			font-size: inherit;
			/* 字体大小继承 */
			color: inherit;
			.iconfont{
				font-size: 45rpx;
			}
			/* 字体颜色继承 */
			.kfliimg {
				width: 45rpx;
				height: 45rpx;
				color: red;
				margin: 0 auto;
			}

			.kflitext {
				margin-top: 15rpx;
				font-size: 24rpx;
				color: rgba(255, 255, 255, 0.7);
			}
		}


			
	}
	
	.xcxkf::after {
		display: none;
		background-color: transparent!important;
		/* 去除按钮后的边框 */
	}
	/deep/.button-hover{
		background-color: transparent!important;
	}
	.xcxkfliimg::after {
		display: none;
		/* 去除按钮后的边框 */
	}
	.xcxkf {
		background-color: transparent!important;
		position: fixed;
		right:0;
		bottom:23%;
		box-sizing: border-box;
		/* 去除内边距 */
		font-size: inherit;
		/* 字体大小继承 */
		color: inherit;
	
		/* 字体颜色继承 */
		.xcxkfliimg {
			width: 65rpx!important;
			height: 65rpx!important;
			color: red;
			margin: 0 auto;
		}
	
		.kflitext {
			margin-top: 15rpx;
			font-size: 24rpx;
			color: #373C43;
		}
	}
</style>